Show the usage message if invalid arguments are given to xm sysrq.
authorEwan Mellor <ewan@xensource.com>
Thu, 14 Sep 2006 06:55:27 +0000 (07:55 +0100)
committerEwan Mellor <ewan@xensource.com>
Thu, 14 Sep 2006 06:55:27 +0000 (07:55 +0100)
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xm/sysrq.py

index 0ef6d3ad8b0d432d275678e4e713e0c75729dce7..67db732757e2b7a78052df55e9dee1be6fc4d146 100644 (file)
@@ -24,8 +24,9 @@ def main(argv):
         return
         
     # no options for the moment
-    if len(args) < 1: opts.err('Missing domain')
-    if len(args) < 2: opts.err('Missing sysrq character')
+    if len(args) != 2:
+        opts.usage()
+        sys.exit(1)
     dom = args[0]
     req = ord(args[1][0])
     server.xend.domain.send_sysrq(dom, req)